<?php
session_start();  
if(!isset($_SESSION['user']) || $_SESSION['user'] == "") {
   echo "<script>alert('登录超时'); self.location='login.php';</script>";
}
?>